<html>
<script>
  // for/in循环的强大之处
  function getvalue(portfoleio) {
    var totlal = 0.0;
    for (stock in portfoleio) {
      var shares = portfoleio[stock];
      // var price = getquote(stock);
      var price =10;
      totlal += shares * price;
      console.log(totlal);
    }
    return totlal;
  }

  var a = getvalue({stock:10,stock1:20});
  alert(a);
</script>



<head>
    <title>放置文章标题</title>
</head>

<body>

</body>

</html>